#include"mystdio.h"

#include<string.h>
#include<unistd.h>
#include<stdio.h>

int main()
{

    MyFILE* fp = my_fopen("log.txt" , "a");
    if(fp==NULL) return 1;

    char data[128];
    const char* s = "hello world";
    int cnt = 20;
    while(cnt--)
    {
        snprintf(data ,sizeof(data) ,  "%s:%d" , s , cnt);
        my_fwrite(data , strlen(data) , fp);
       // sleep(1);
    }

    my_fclose(fp);

    return 0;
}
